package br.com.players.service;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class EntityManagerFactoryHelper {

    private static EntityManagerFactory factory;

    static {
        try {
        	factory = Persistence.createEntityManagerFactory("players");
        } catch(ExceptionInInitializerError e) {
            throw e;
        }
    }

    public static EntityManager getEntityManager() {
        return factory.createEntityManager();
    }
}